(function (aopc) {
    aopc.addExpandPage(833, function (get) {
        const Bridge = get('UtilsCommon', 'Bridge');
        const PageCommon = get('UtilsCommon', 'PageCommon');

        return {
            expandInit() {
                this.toolbars_item_view4 = this.getProperty('toolbars_item_view4');
            },
            componentDidmount() {
                Bridge.setReceiveFunction('openFileCompleted', (data) => {
                    PageCommon.setLoading(false);
                    this.isLoading = false;
                    //this.toolbars_item_view4.setIsVisible(data.isOffice);
                });

                this.openFile(this.pageData);
            },
            showToolBars() {
                if (this.isLoading) return;

                Bridge.jsToNative('showToolBars');
            },
            openFile(data) {
                if (this.isLoading) return;
                this.isLoading = true;
                PageCommon.setLoading(true, true, '文件加载中...');
                Bridge.openFile(data);
            },
            changeFile({ property }) {
                if (this.isLoading) return;
                const { MeetingId } = this.pageData;
                Bridge.jsToNative('changeFile', { MeetingId }, (data) => {
                    if (data.isOpenFile) this.openFile(data);
                })
            },
            toBack2() {
                if (this.isLoading) return;
                Bridge.jsToNative('closeFile', null, () => {
                    this.toBack();
                });
            },
            setLeftExpand({ property, view }) {
                property.isExpand = !property.isExpand;
                const imgUrl = property.isExpand ? 'images/yxinmt_h5/25030415290642258.png' : 'images/yxinmt_h5/25030415283495238.png';
                property.setValue(imgUrl);

                const p2 = view.properties[0].properties[0];
                if (property.isExpand) p2.style.top = 0;
                else delete p2.style.top;
                p2.refresh();
            },
            setRightExpand({ property, view }) {
                property.isExpand = !property.isExpand;
                const imgUrl = property.isExpand ? 'images/yxinmt_h5/25030415111201751.png' : 'images/yxinmt_h5/25030414104084518.png';
                property.setValue(imgUrl);

                const p2 = view.properties[0].properties[0];
                if (property.isExpand) p2.style.top = 0;
                else delete p2.style.top;
                p2.refresh();
            }
        }
    });
})(window.aopc);